
package guoan.domain;

import guoan.core.jodaJson.DateTimeYYYYMMDDHHMMSSSerializer;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Type;
import org.joda.time.DateTime;
import org.springframework.format.annotation.DateTimeFormat;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

/**
 * 预约考试
 * 
 */
@Entity
@Table(name = "adv_type")
public class AdvType implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * ID 自动增长
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    /**
     * 名称
     */
    private String title;

    /**
     * 创建时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = DateTimeYYYYMMDDHHMMSSSerializer.class)
    @Type(type = "org.jadira.usertype.dateandtime.joda.PersistentDateTime")
    @Column(name = "create_time")
    private DateTime createTime;

    /**
     * 简介
     */
    private String content;

    /**
     * 图片URL
     */
    @Column(name = "img_url")
    private String imgUrl;

    /**
     * 外部URL
     */
    @Column(name = "w_url")
    private String wUrl;

    /**
     * 排序ID
     */
    @Column(name = "order_id")
    private Long orderId;

    /**
     * 是否显示
     */
    private Long showing;

    @Column(name = "adv_type_key")
    private String advTypeKey;

    @OneToMany(mappedBy = "advType",fetch=FetchType.LAZY)
    @JsonIgnore
    private List<Adv> advList;

    public Long getId(){
        return id;
    }

    public void setId(Long id){
        this.id = id;
    }

    public String getContent(){
        return content;
    }

    public void setContent(String content){
        this.content = content;
    }

    public DateTime getCreateTime(){
        return createTime;
    }

    public void setCreateTime(DateTime createTime){
        this.createTime = createTime;
    }

    public String getTitle(){
        return title;
    }

    public void setTitle(String title){
        this.title = title;
    }

    public String getAdvTypeKey(){
        return advTypeKey;
    }

    public void setAdvTypeKey(String advTypeKey){
        this.advTypeKey = advTypeKey;
    }

    public List<Adv> getAdvList(){
        return advList;
    }

    public void setAdvList(List<Adv> advList){
        this.advList = advList;
    }

    public String getImgUrl(){
        return imgUrl;
    }

    public void setImgUrl(String imgUrl){
        this.imgUrl = imgUrl;
    }

    public String getwUrl(){
        return wUrl;
    }

    public void setwUrl(String wUrl){
        this.wUrl = wUrl;
    }

    public Long getOrderId(){
        return orderId;
    }

    public void setOrderId(Long orderId){
        this.orderId = orderId;
    }

    public Long getShowing(){
        return showing;
    }

    public void setShowing(Long showing){
        this.showing = showing;
    }

}